package com.atguigu.observer.improve;

public class Client {

	public static void main(String[] args) {
		
		
		//创建一个WeatherData
		SubjectForWeather weather = new SubjectForWeather();
		
		//创建观察者
		ObserverForQQ qq = new ObserverForQQ();
		ObserverForBaidu baidu = new ObserverForBaidu();
		
		//注册到weatherData
		weather.registerObserver(qq);
		weather.registerObserver(baidu);
		
		//测试
		System.out.println("通知各个门户网站的观察者, 看看信息");
		weather.setData(10f, 100f, 30.3f);
		
		// QQ 网站删除
		weather.removeObserver(qq);
		
		//测试
		System.out.println();
		System.out.println("通知各个门户网站的观察者, 看看信息");
		weather.setData(10f, 100f, 30.3f);
	}

}
